//
//  ChannelNetEventhandler.h
//  gzline
//
//  Created by hsm on 3/26/13.
//
//

#import <Foundation/Foundation.h>

#import "AsyncSocket.h"
#import "XMPPParser.h"

#import "DDXML.h"


 
//网络事件回调
@protocol PokerNetEventHandlerDelegate
@required
-(void)didConnect;
-(void)streamDidOpen:(DDXMLElement *)root;
-(void)didReadElement:(DDXMLElement*)xmlElement;
-(void)didDisconnect;
-(void)networkStateChanged;
@end

/*底层网络事件处理类，只能与XmppClient交互*/
@interface PokerNetEventHandler : NSObject {
    AsyncSocket *socket;
    XMPPParser *xmlParser;
    id deletate;
    NSMutableData *recvData;

}
@property (nonatomic, assign) id deletate;
/*++++++++++提供给XmppClient调用的方法+++++++++++++*/
-(void)acceptOnPort:(UInt16)port;
-(void)connectToHost:(NSString*)ip onPort:(NSInteger)aPort;
-(void)sendString:(NSString*)str;
-(void)sendNetData:(NSData *)netData;
-(void)sendElement:(DDXMLElement*)xmlElement;
-(BOOL)isConnected;
-(void)disconnect;
/*返回当前网络类型，gprs或者wifi*/
-(NSString*)currentNetworkType;

/*+++++++++++++++++++++++++++++++++++++++++++++*/


@end
